
<#assign str="123" str1="123\"456\'789" str2=r"${user}">

<#assign a="${user}">
<#assign b=r"${user}">

<#assign a="hello ${user}">
<#assign a="hello" + user>

<#assign str="abcd">
${str[0]}

<#assign s = "ABCDEF">
${s[2..3]}
${s[2..<4]}
${s[2..*3]}
${s[2..*100]}
${s[2..]}

${"08"} ${+8} ${8.00} ${8}

<#assign list=["a", "b", "c"]>
<#assign list1=[3, list, "b"]>
<#assign list2 = list1 + list>
${list2?size}

1、<#list list[0..*2] as i>${i}</#list>
2、<#list list[1..*2] as i>${i}</#list>
3、<#list list[2..*2] as i>${i}</#list>
4、<#list list[3..*2] as i>${i}</#list>
5、<#list list[0..] as i>${i}</#list>
6、<#list list[1..] as i>${i}</#list>
7、<#list list[2..] as i>${i}</#list>
8、<#list list[3..] as i>${i}</#list>

<#assign map={"name": "zhangsan", "age":18, "score":[80, 90, 100]}>
${map.name}
${map["age"]}

${mouse!"No mouse."}
<#assign mouse="mouse">
${mouse!"No mouse."}

${user.name!"no name"}
${(user.name)!"no"}

<#if mouse??>
    Mouse found
<#else>
    No mouse found
</#if>